#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>

int rotate(char* p, int sz, int m)
{
	int j = 0;
	int n = 0;
	for (j = 0; j < m; j++)
	{
		char a = *(p + 0);
		for (n = 1; n < sz; n++)
		{
			*(p + n - 1) = *(p + n);
		}
		*(p + n - 1) = a;
	}
}
int main()
{
	char arr[] ="abcdef";
	printf("%s\n", arr);
	int m = 0;
	int sz = sizeof(arr) / sizeof(arr[0]);
	scanf("%d", &m);
	int ret = rotate(arr, sz, m);
	int i = 0;
	for (i = 0; i < sz; i++)
	{
		printf("%c", arr[i]);
	}
	return 0;
}